import request from '../utils/request';

export function login ({ values }) {
    return request(`/user/login`,{
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(values)
    });
}

export function logout () {
    return request(`/user/logout`,{
        method: 'POST',
        headers: { 'Content-Type': 'application/json' }
    });
}

export function query ( params ) {
    return request(`/user/search`,{
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(params)
    });
}

export function menu ({ permissions }){
    return request(`/user/menu`,{
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(permissions)
    });
}
